﻿using UnityEngine.Events;
using UnityEditor.AnimatedValues;

namespace Miao
{
    public class BoolFade//对编辑器AnimBool的封装
    {
        public float FadeValue { get { return animBool.faded; } }

        private AnimBool animBool;

        public BoolFade(UnityAction callback)
        {
            animBool = new AnimBool();
            animBool.valueChanged.AddListener(callback);
        }

        public void SetFadeSpeed(float speed)//设置渐变速度
        {
            animBool.speed = speed;
        }
        public void SetTargetValue(bool TargetValue)//设置目标渐变值
        {
            animBool.target = TargetValue;
        }
    }
}